package Server;

import interfaces.TDARestourante;

import java.net.MalformedURLException;
import java.rmi.*;
import java.rmi.registry.LocateRegistry;

import Negocio.Restourante;
 

public class Server {
	
	TDARestourante objetoRemoto; 
	
	public static void main (String[] args)
	{
		new Server();
	}
	
	public Server  ()
	{
		Inicialisar();
	}
	
	public void Inicialisar ()
	{
		try {
    		LocateRegistry.createRegistry(1099);	
    		TDARestourante gestionRestourante = (TDARestourante) Restourante.getInstance();	
            Naming.rebind ("//localhost/Restourante", gestionRestourante);
			System.out.println("Fijado en //localhost/Restourante");
			
		} catch (RemoteException e) {
			System.out.println("Remote exception: " + e.toString());
		}
        catch (MalformedURLException e) {
			e.printStackTrace();
        }
	}
}
